#ifndef MATERIAL_H
#define MATERIAL_H

#include <QImage>

#include "object/bindable.h"

class QString;

class Material : public Bindable
{
public:
    Material(const QString& rkName, const QString& rkTextureFileName, float fShininess,
             float fAmbientRed, float fAmbientGreen, float fAmbientBlue,
             float fDiffuseRed, float fDiffuseGreen, float fDiffuseBlue,
             float fSpecularRed, float fSpecularGreen, float fSpecularBlue);
    ~Material();

    bool isValid() const;

    QString name() const;

    float shininess() const;

    float ambientRed() const;
    float ambientGreen() const;
    float ambientBlue() const;

    float diffuseRed() const;
    float diffuseGreen() const;
    float diffuseBlue() const;

    float specularRed() const;
    float specularGreen() const;
    float specularBlue() const;

    void bind() const;
    void unbind() const;

    void loadGPU();
    void unloadGPU();

protected:
    Material(const Material&);
    Material& operator = (const Material&);

private:
    //------------------------------------------------
    //  Attributes.
    //------------------------------------------------
    bool    m_bIsValid;
    QString m_kName;

    // Lights.
    float   m_fShininess;
    float   m_fAmbientRed,  m_fAmbientGreen,  m_fAmbientBlue;
    float   m_fDiffuseRed,  m_fDiffuseGreen,  m_fDiffuseBlue;
    float   m_fSpecularRed, m_fSpecularGreen, m_fSpecularBlue;

    // Texture.
    QImage  m_kImage;
};

#endif // MATERIAL_H
